package com.yanmaohu.yulia.bean;

import java.util.List;

/**
 * @author Bright Lee
 */
public final class MergeInsertSpecification {

    private int beginIndex;
    private int endIndex;
    private IdentifierList insertColumnList;
    private OverrideClause overrideClause;
    private List<MergeInsertValueElement> mergeInsertValueList;

    public MergeInsertSpecification(int beginIndex,
                                    int endIndex,
                                    IdentifierList insertColumnList,
                                    OverrideClause overrideClause,
                                    List<MergeInsertValueElement> mergeInsertValueList) {
        this.beginIndex = beginIndex;
        this.endIndex = endIndex;
        this.insertColumnList = insertColumnList;
        this.overrideClause = overrideClause;
        this.mergeInsertValueList = mergeInsertValueList;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public IdentifierList getInsertColumnList() {
        return insertColumnList;
    }

    public OverrideClause getOverrideClause() {
        return overrideClause;
    }

    public boolean isMergeInsertValueListEmpty() {
        if (mergeInsertValueList == null) {
            return true;
        }
        return mergeInsertValueList.isEmpty();
    }

    public int mergeInsertValueListSize() {
        if (mergeInsertValueList == null) {
            return 0;
        }
        return mergeInsertValueList.size();
    }

    public MergeInsertValueElement getMergeInsertValue(int index) {
        return mergeInsertValueList.get(index);
    }

}
